package com.wjpeng.wms.domain;

import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

//订单
@Setter @Getter
public class Orderbill {
    public static final Integer NORMAL = 1;//未审核状态
    public static final Integer AUDIT = 2;//已审核状态

    private Long id;
    private String sn;//采购单号
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date vdate;//业务时间
    private Integer status = NORMAL;//单据状态
    private BigDecimal totalAmount;//采购总额
    private BigDecimal totalNumber;//采购总数量
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date auditTime;//审核状态
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date inputTime;//录入状态

    private Employee inputUser;//录入人
    private Employee auditUser;//审核人
    private Supplier supplier;//供应商

    //包含的采购明细 组合关系
    private List<OrderBillItem> items = new ArrayList<>();

    /*
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `sn` varchar(255) DEFAULT NULL,
  `vdate` datetime DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `totalAmount` decimal(19,2) DEFAULT NULL,
  `totalNumber` decimal(19,2) DEFAULT NULL,
  `auditTime` datetime DEFAULT NULL,
  `inputTime` datetime DEFAULT NULL,
  `inputUser_id` bigint(20) DEFAULT NULL,
  `auditor_id` bigint(20) DEFAULT NULL,
  `supplier_id` bigint(20) DEFAULT NULL,
     */
}
